import Vue from 'vue'
import Vuex from 'vuex'
import router from 'src/router'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
      isLoading: false,
      user: {
        name: 'kai',
        avatar: '/',
        userId: 0
      },
      notreadmsg:{//未读消息
        notReadLike:0,//点赞未读
        notReadComment:0,//评论未读
        notReadSysMsg:0,//系统未读消息
        notreadleavemsg:0,//小绿留言未读
        notreadrec:0,//推荐未读
      },
      allnotreadnum:0,//未读消息总数
      topicstatus: -1,//话题tab选中
      topicdetail:'1',
      saystatus:'1',
      replacestatus:'3',
      isMyPublishStatue:true,
      myPublishStatue:'12',
      interactionSelected:'1',
      isShow: true,
      indextabbarselected:0,
      ylmessageselected:0,
      indexmoretopicpage:1,
      collectionselected:0,
      searchresultselected:0,
      usercoin:0,//用户绿币
  },
  mutations: {
    changetopicstatus(state,navstatus){
      state.topicstatus = navstatus
    },
    changetopicdetail(state,navstatus){
      state.topicdetail = navstatus
    },
    changesaystatus(state,navstatus){
      state.saystatus = navstatus
    },
    changereplacestatus(state,navstatus){
      state.replacestatus = navstatus
    },
    changeisMyPublishStatue(state,navstatus){
      state.isMyPublishStatue = navstatus
    },
    changemyPublishStatue(state,navstatus){
      state.myPublishStatue = navstatus
    },
    changeinteractionSelected(state,navstatus){
      state.interactionSelected = navstatus
    },
    changeindextabbarselected(state,navstatus){
      state.indextabbarselected = navstatus
    },
    changeylmessageselected(state,navstatus){
      state.ylmessageselected = navstatus
    },
    changeindexmoretopicpage(state,navstatus){
      state.indexmoretopicpage = navstatus
    },
    changecollectionselected(state,navstatus){
      state.collectionselected = navstatus
    },
    changesearchresultselected(state,navstatus){
      state.searchresultselected = navstatus
    },
    changeShow(state,obj){
      state.isShow = obj
    },
    changenotreadmsg(state,obj){
      state.notreadmsg = obj
    },
    changeusercoin(state,navstatus){
      state.usercoin = navstatus
    },
    changeallnotreadnum(state,navstatus){
      state.allnotreadnum = navstatus
    },
  }
})

export default store
